//
//  DataManger.m
//  ChipmunkEditor
//
//  Created by Rewolf Us on 11-2-3.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "DataManager.h"
#import "cmTypes.h"
#import "SpaceManager.h"
#import "TestbedLayer.h"
#import "DrawLayer.h"

@implementation DataManager
@synthesize appControllerDelegate;

/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////// Singleton ///////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
- (void) dealloc
{
	[super dealloc];
}

- (id) init
{
	self = [super init];
	
	if(self)
	{
	}
	
	return self;
}

static DataManager *sharedManager = nil;

+ (DataManager *) sharedData
{
    @synchronized(self)
	{
        if (sharedManager == nil)
		{
            [[self alloc] init];
        }
    }
	
    return sharedManager;
}

+ (id)allocWithZone:(NSZone *)zone
{
    @synchronized(self)
	{
        if(sharedManager == nil)
		{
            sharedManager = [super allocWithZone:zone];
            return sharedManager;
        }
    }
	
    return nil;
}

- (id)copyWithZone:(NSZone *)zone
{	
    return self;
}

- (id) retain
{
    return self;
}

- (NSUInteger) retainCount
{
    return UINT_MAX;
}

- (void) release
{
	[super release];
}

- (id) autorelease
{
    return self;
}
@end
